Skip to content

Conversation

@shafik
Copy link
Collaborator

@shafik shafik commented Jun 12, 2025

Static analysis flagged Input as a large object that would benefit from being moved over being copied.

Static analysis flagged Input as a large object that would benefit from being
moved over being copied.
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jun 12, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 12, 2025

@llvm/pr-subscribers-clang

Author: Shafik Yaghmour (shafik)

Changes

Static analysis flagged Input as a large object that would benefit from being moved over being copied.


Full diff: https://github.com/llvm/llvm-project/pull/143830.diff

1 Files Affected:

  • (modified) clang/lib/Frontend/CompilerInstance.cpp (+1-1)
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 587b0d1af9c8d..09a66b652518f 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1191,7 +1191,7 @@ std::unique_ptr<CompilerInstance> CompilerInstance::cloneForModuleCompileImpl(
   FrontendOpts.OriginalModuleMap = std::string(OriginalModuleMapFile);
   // Force implicitly-built modules to hash the content of the module file.
   HSOpts.ModulesHashContent = true;
-  FrontendOpts.Inputs = {Input};
+  FrontendOpts.Inputs = {std::move(Input)};
 
   // Don't free the remapped file buffers; they are owned by our caller.
   PPOpts.RetainRemappedFileBuffers = true;

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shafik shafik merged commit e4c32a4 into llvm:main Jun 12, 2025
9 checks passed
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
Static analysis flagged Input as a large object that would benefit from
being moved over being copied.
@shafik shafik deleted the cloneForModuleCompileImplMovInput branch June 15, 2025 05:28
akuhlens pushed a commit to akuhlens/llvm-project that referenced this pull request Jun 24, 2025
Static analysis flagged Input as a large object that would benefit from
being moved over being copied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants